#include <gtest/gtest.h>
#include <lcir/ADT/IList.h>
#include <lcir/ADT/ListNode.h>
#include <lcir/ADT/OwningRefVector.h>
#include <lcir/ADT/Range.h>

#include <iterator>
#include <memory>
#include <sstream>
#include <vector>
using namespace lcir;
class Node;
class Parent {
 IList<Node> list;
};
class Node : public lcir::IListNode<Node> {
public:
  int a;
  Node(int a) : a(a) {}
  ~Node() {}
};
void listPrint(const IList<Node> &list) {
  auto r0 = ReverseRange(list);
  auto r = IncRange(r0);
  for (auto &a : r) {
    std::cout << a.a << std::endl;
    // list.erase(&a);
  }
}
TEST(ADT, IList) {
  IList<Node> list;
  Node *a1 = new Node(1);
  Node *a2 = new Node(2);
  Node *a3 = new Node(3);
  Node *a4 = new Node(4);
  list.pushBack(a1);
  list.pushBack(a2);
  list.pushBack(a4);
  IList<Node>::iterator it(a3);
  list.insertAfter(list.end(), it);

  // listPrint(list);
}
